/** 商品规格api接口访问模块 */
import axios from '../utils/request'

// 分页获取规格列表
export const getSpecsApi = (page, size) => axios({
  url: '/api/specslist',
  params: { page, size }
})

// 获取规格总数
export const getSpecsTotalApi = () => axios({
  url: '/api/specscount'
})

// 添加规格
export const addSpecsApi = (specsForm) => axios({
  url: '/api/specsadd',
  method: 'post',
  data: specsForm
})

// 删除规格
export const delSpecsApi = id => axios({
  url: '/api/specsdelete',
  method: 'post',
  data: { id }
})

// 编辑规格
export const editSpecsApi = specsForm => axios({
  url: '/api/specsedit',
  method: 'post',
  data: specsForm
})